package top.zhangjianyong.utils.coding;

import java.util.UUID;

/**
 * @program: topzhangjianyongutils
 * @description: String工具类
 * @author: 张建勇
 * @create: 2019-03-15 08:44
 **/
public class StringUtil {

    /**
     * 获取UUID
     *
     * @return
     */
    public static String getUUID() {
        return UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
    }

    /**
     * 判断字符为空
     *
     * @param s
     * @return
     */
    public static boolean isBlank(String s) {
        if (s == null || "".equals(s))
            return false;
        return true;
    }

    /**
     * 判断字符不为空
     *
     * @param s
     * @return
     */
    public static boolean isNotBlank(String s) {
        if (s != null && !"".equals(s))
            return true;
        return false;
    }

    public static void main(String[] args) {
        String s = HexStrUtil.hexStr2Str(getUUID());
        System.out.println(s);
        System.out.println(isBlank("2"));
    }

}
